package com.itheima.附加题.work2;

public abstract class Hero {
    private String name;//名称
    private int hp;//血量
    private int mp;//魔法值
    private int attack;//攻击力
    private int defenses;//防御力

    public abstract void say();
    //放技能
    public void startAnility(Anility anility){
        int mpConsume = anility.getMpConsume();//蓝量
        if(mp<mpConsume){
            System.out.println("魔法不足,释放失败");
        }else{
            mp-=mpConsume;
            double v = anility.getMultiple() * this.attack;
            System.out.println(this.name+"发动技能"+anility.getName()+"，耗费"+mpConsume+"点魔法，对敌人造成"+v+"点攻击！");
        }
    }
    //发动一技能
    public abstract void startFirstAbility();
    //发动二技能
    public abstract void startSecondAbility();
    //发动三技能
    public abstract void startThirdAbility();



    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getHp() {
        return hp;
    }

    public void setHp(int hp) {
        this.hp = hp;
    }

    public int getMp() {
        return mp;
    }

    public void setMp(int mp) {
        this.mp = mp;
    }

    public int getAttack() {
        return attack;
    }

    public void setAttack(int attack) {
        this.attack = attack;
    }

    public int getDefenses() {
        return defenses;
    }

    public void setDefenses(int defenses) {
        this.defenses = defenses;
    }

    public Hero(String name, int hp, int mp, int attack, int defenses) {

        this.name = name;
        this.hp = hp;
        this.mp = mp;
        this.attack = attack;
        this.defenses = defenses;
    }

    public Hero() {

    }
}
